﻿using System.Collections.Generic;

namespace Common.ParameterLocator
{

    public static class DefaultParameter
    {
        public static string TfsPasswordConnexion
        {
            get { return string.Empty; }
        }

        public static string TfsUserNameConnexion
        {
            get { return string.Empty; }
        }

        public static List<ReplaceElement> TextReplacement
        {
            get
            {
                var defaultReplacedElement = new List<ReplaceElement>
                                                 {
                                                     new ReplaceElement {From = ((char) 130).ToString(), To = "\'"},
                                                     new ReplaceElement {From = ((char) 132).ToString(), To = "\""},
                                                     new ReplaceElement {From = ((char) 133).ToString(), To = "..."},
                                                     new ReplaceElement {From = ((char) 145).ToString(), To = "\'"},
                                                     new ReplaceElement {From = ((char) 146).ToString(), To = "\'"},
                                                     new ReplaceElement {From = ((char) 147).ToString(), To = "\""},
                                                     new ReplaceElement {From = ((char) 148).ToString(), To = "\""}
                                                 };
                return defaultReplacedElement;
            }
        }

        public static string InconclusiveMessage
        {
            get { return "Method is not (yet) implemented"; }
        }

        public static string TfsServerUrl
        {
            get { return "http://my-pc:8080/tfs"; }
        }

        public static string TfsWorkitemType
        {
            get { return "Récit utilisateur"; }
        }

        public static string TfsQueryUserStory
        {
            get
            {
                return
                    "Select [System.WorkItemType], [System.Title] From WorkItems Where [System.WorkItemType] = '{0}' and [System.TeamProject] ='{1}'";
            }
        }

        public static string FormatParameter
        {
            get { return "(.*)"; }
        }

        public static string FolderName
        {
            get { return "SpecFlow_{0}"; }
        }

        public static string FormatDisplayParameter
        {
            get { return "{0} var{1}"; }
        }

        public static string RegexFindParameter
        {
            get { return "\"([^\"]*)\""; }
        }

        public static string RegexCleanStatement
        {
            get { return "^Given|^When|^Then|^And"; }
        }

        public static string RegexFindStatement
        {
            get { return "^Given (.*)|^When (.*)|^Then (.*)|^And (.*)"; }
        }
    }

    public class ReplaceElement
    {
        public string From { get; set; }
        public string To { get; set; }

        public override string ToString()
        {
            return string.Format("{0} -> {1}", From, To);
        }
    }
}